-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[DRAFT] Add -mfix-imm48 option #32
base: nanomips
Are you sure you want to change the base?
Conversation
auto ImmValueNeedsImm48Fix = [MI](int64_t Value) -> bool { | ||
if ((MI->getOpcode() == Mips::Li_NM) && | ||
(isUInt<16>(Value) || isInt<9>(Value) || ((Value && 0xfffu) == 0u))) | ||
return false; | ||
return ((Value & (1u << 9)) == (1u << 9)) || | ||
((Value & (7u << 8)) == (1u << 8)) || | ||
(Value & 0x64005001u) == (0x24005001u); | ||
}; | ||
|
||
if (!ImmValueNeedsImm48Fix(Value)) | ||
return false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Single use of lambda, would be better to just use directly?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or I guess a static
function for factoring out the logic of the code is even better.
0846e70
to
a05fdd2
Compare
@draganmladjenovic @cme can we merge this? |
Needs tests